from sklearn.preprocessing import Binarizer
import numpy as np

x=np.random.randn(5,5)

bn=Binarizer(threshold=0)
x_erzhi=bn.fit_transform(x)
print(x)
print(x_erzhi)